<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>方法</title>
    <script src="../../vue.js"></script>
</head>
<body>
<div id="box">
    <h1 v-on:click="hao">123456</h1>
</div>

<script>
    var vm = new Vue({
        el:'#box',
        methods:{
            hao:function () {
                alert(1);
            }
        }
    })
</script>
</body>
</html>